home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!fischerj
- From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Passing arguments to a thread
- Date: 30 Jan 1996 16:13:20 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4elg30$695@sunsystem5.informatik.tu-muenchen.de>
- References: <4ed1eq$nfi@newsy.ifm.liu.se>
- NNTP-Posting-Host: hphalle7g.informatik.tu-muenchen.de
- Originator: fischerj@hphalle7g.informatik.tu-muenchen.de
-
-
- In article <4ed1eq$nfi@newsy.ifm.liu.se>, d93marbl@isy.liu.se (Martin Blom) writes:
- |> Lines: 19
- |> Message-ID: <4ed1eq$nfi@newsy.ifm.liu.se>
- |> NNTP-Posting-Host: mut.isy.liu.se
- |> Mime-Version: 1.0
- |> Content-Type: text/plain; charset=iso-8859-1
- |> Content-Transfer-Encoding: 8bit
- |> X-Newsreader: NN version 6.5.0 #26 (NOV)
- |>
- |> Is there a (nice) way to pass arguments to a new process?
- |> Right now I allocate some memory and copy the following code:
- |> Kick:
- |> lea kick(pc),a1
- |> move.l #0,a0
- Why not load a0 from a global var ?
- |> jmp ThreadStart
- Isn't this rather a jmp (a0) ?
-
- |>
- |> ... modify the #0 to point to my data structure, flush the cache and
- |> start the process (which does FreeVec(a1)).
- |>
- |> Somehow, this does not seem like a nice solution.
- |>
- |> The code is located in a shared library.
-
-
- I don't know if I understood the problem right.
-
- You created a new task and want to pass args to it, with the code
- beeing shared-lib code ?
-
- Well, I'd use global vars. A library can have global vars, if I
- understood right (I'd call intbase->activewindow a var global
- for the intuilib).
-
- idea:
-
- argsema dc.l 0
- arg dc.l 0
-
-
- calltask:
-
- forbit() ;mhm just for the case permit() needs a forbid(), don't know ;)
- getsema:
- permit()
- delay(1)
-
- forbid()
- tst.l argsema
- bne getsema
-
- move.l #1,argsema
- move.l a0,arg ;you called "calltask" with args in a0
-
-
- ; do a proper call of createproc
-
- permit() ;well if createproc does not keep in forbid state, I'm in deep shit.
- ;this task will go on in permit state and other task will be put
- ;in a list, right ?
-
- ds.l 0
- seglist:
- dc.l 0
- dc.l 16
- dc.l 0
- newtaskcode:
- tst.l argsema
- bne newtaskcode
-
- move.l arg,a0 ;Now I imho got the info that was passed to "calltask"
-
- clr.l argsema ;free variable for other tasks that use "calltask".
-
- ....
-
-
- Well, can it be done like that ? I bet normally it's done different
- on Amiga, but would this work ?
-
-
- Or is there a clever way that also would work for multiprocessor systems ;)
-
- Another question: are multiple tasks allowed to putpixel() or
- blitXXX() into same window / screen (using the same handle!) ?
-
- What are the limits when tasking ?
-
- |>
- |> --
- |> +--------- Martin 'Leviticus' Blom ----------+ Commodore 128D
- |> | Linkoping Institute of Technology - Sweden | Amiga 4000/040
- |> +----------- lcs@lysator.liu.se -------------+
- |> http://www.lysator.liu.se/~lcs/
- ------------------------------------------------------------------------
- fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) =:)
-
-